ByteIO
 
 
 Bean ByteIO
 
General Byte Input/Output (8 bits)

Typical usage of the bean in user's code.

Typical Usage:

Required bean name is "Byte1".
Examples of typical usage of this bean follow:

(1)
The direction of the bean is set to input.

 MAIN.C

void main(void)
{
  /* Wait until "10101010" is on the port */
  while( Byte1_GetVal() != 0xAA );
    :
}

(2)
The direction of the bean is set to output.

 MAIN.C

void main(void)
{
  Byte1_PutVal(0xAA);  // "10101010" is on the port
  
  for (;;) {
  /* Invert output level of fourth pin on the port */
    Byte1_NegBit(3);
  }
}

(3)
The direction of the bean is set to input/output.

 MAIN.C

void main(void)
{
  Byte1_SetDir(FALSE);  // Set input mode

  /* Wait until "11111111" is on the port */
  while( Byte1_GetVal() != 0xFF );
  
  Byte1_SetDir(TRUE);   // Set output mode

  Byte1_PutVal(0);      // Set "00000000" on the port
}

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.